import requests
import config

class GoodsAPI:
    def __init__(self):
        self.__url_list = config.BATH_URL + "/category/all"
        self.__url_under = config.BATH_URL + "/product/by_category?id={}"
        self.__url_info = config.BATH_URL + "/product/{}"

    def get_list(self):
        return requests.get(url=self.__url_list)

    def get_under(self,id111):
        return requests.get(url=self.__url_under.format(id111))

    def get_info(self,id222):
        return requests.get(url=self.__url_info.format(id222))

if __name__ == '__main__':
    print(GoodsAPI().get_list().json())
    print("-" * 100)
    print(GoodsAPI().get_under(3).json())
    print("-" * 100)
    print(GoodsAPI().get_info(7).json())